package cn.wusifx.zabbix.request.builder.trigger;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.RequestBuilder;

import java.util.HashMap;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/trigger/adddependencies
 */
public class TriggerAddDependenciesRequestBuilder extends RequestBuilder<Map<String,String>> {
    private String triggerId;
    private String dependsOnTriggerId;
    public TriggerAddDependenciesRequestBuilder(String auth) {
        super("trigger.adddependencies", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public TriggerAddDependenciesRequestBuilder(Long id, String auth) {
        super("trigger.adddependencies", id, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public TriggerAddDependenciesRequestBuilder setParam(String key, String value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public TriggerAddDependenciesRequestBuilder setParams(Map<String,String> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    public String getTriggerId() {
        return triggerId;
    }

    public TriggerAddDependenciesRequestBuilder setTriggerId(String triggerId) {
        this.triggerId = triggerId;
        return this;
    }

    public String getDependsOnTriggerId() {
        return dependsOnTriggerId;
    }

    public TriggerAddDependenciesRequestBuilder setDependsOnTriggerId(String dependsOnTriggerId) {
        this.dependsOnTriggerId = dependsOnTriggerId;
        return this;
    }

    @Override
    public BaseRequest<Map<String, String>> builder() {
        baseRequest.getParams().put("triggerid",triggerId);
        baseRequest.getParams().put("dependsOnTriggerid",dependsOnTriggerId);
        return baseRequest;
    }
}
